package com.juc.executors.executors7;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Run {
     /**
      * 创建单一线程池 可以实现以队列的方式执行任务
      * 
      */
	public static void main(String[] args) {
		ExecutorService executorService = Executors.newSingleThreadExecutor();
	    for (int i = 0; i < 3; i++) {
	    	executorService.execute(new MyRunable("" + (i+1)));
		}
	}
}
